package common.action;

import common.domain.Product;

import java.util.ArrayList;
import java.util.List;

/**
 * 用来当作数据库使用
 */
public class SaveProductAction {

    private List<Product> resultList = new ArrayList<Product>();

    public SaveProductAction() {
        Product product1 = new Product("MacBookPro", "电脑", 12888.88f);
        Product product2 = new Product("《Spring MVC 学习指南》", "书本", 39.98f);
        resultList.add(product1);
        resultList.add(product2);
    }

    public Product save(Product product) {
        resultList.add(product);
        return product;
    }


}
